package edu.whu.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.whu.demo.domain.User;
import edu.whu.demo.domain.UserDto;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserDao extends BaseMapper<User> {
    // 定义一个名为getUser的方法，接收一个名为id的参数，返回值类型为UserDto
    // 该方法用于根据用户ID查询用户信息
    @Select("select * from user where id =  #{id}")
    // 指定查询结果中id字段对应的实体类属性为id
    @Results({@Result(id = true, property = "id", column = "id")})
    public UserDto getUser(String id);
}

